@layer base {
  body {
    display: grid;
    grid-template-rows: auto 1fr auto 9em;

    &.public {
      grid-template-rows: auto 1fr auto;
    }
  }

  :where(#main) {
    inline-size: 100dvw;
    margin-inline: auto;
    max-inline-size: 100dvw;
    padding-inline:
      calc(var(--main-padding) + env(safe-area-inset-left))
      calc(var(--main-padding) + env(safe-area-inset-right));
    text-align: center;
  }

  :where(#footer) {
    max-inline-size: 100dvw;
  }

  :where(#header) {
    position: relative;
    z-index: var(--z-nav);
  }

  :is(#header, #footer) {
    @media print {
      display: none;
    }
  }
}
